# 73. 矩阵置零
matrix = [[1,1,1],[1,0,1],[1,1,1]]
matrix = [[0,1,2,0],[3,4,5,2],[1,3,1,5]]

# 矩阵置零
def setZeroes(matrix):
    x = len(matrix[0])
    y = len(matrix)
    needZero = []
    for i in range(0, y):
        for j in range(0, x):
            if matrix[i][j] == 0:
                needZero.append([i, j])
            pass
    needzerox = set()
    needzeroy = set()
    for i in needZero:
        needzerox.add(i[0])
        needzeroy.add(i[1])
    reslist = matrix.copy()
    for i in range(0, y):
        if i in needzerox:
            for j in range(0, x):
                reslist[i][j] = 0
        else:
            for j in range(0, x):
                if j in needzeroy:
                    reslist[i][j] = 0
    return reslist


# print(setZeroes(matrix))

# 74. 搜索二维矩阵
matrix = [[1,3,5,7],[10,11,16,20],[23,30,34,60]]
target = 3
def searchMatrix(matrix, target):
    x = len(matrix[0])
    y = len(matrix)
    starty = 0
    endy = y - 1
    targety = 0
    while matrix[endy][0] > target:

        pass
    return 1

print(searchMatrix(matrix, target))